using SDF.Core.Domain.Projects;

namespace SDF.Data.Mapping.Projects
{
    public partial class ProjectMappingMap : SDFEntityTypeConfiguration<ProjectMapping>
    {
        public ProjectMappingMap()
        {
            this.ToTable("ProjectMapping");
            this.HasKey(sm => sm.Id);

            this.Property(sm => sm.EntityName).IsRequired().HasMaxLength(400);

            this.HasRequired(sm => sm.Project)
                .WithMany()
                .HasForeignKey(sm => sm.ProjectId)
                .WillCascadeOnDelete(true);
        }
    }
}